package com.mindtalk.screen;

import com.mindtalk.R;
import com.mindtalk.helper.Constants;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainTab extends TabActivity {
	
	/*
	 * Class Tab Utama ketika Setelah Login
	 * */
	
	/* Daftar Variable */
	
	/*
	 * TabHost
	 * */
	private TabHost tabhost;
	/*
	 * Jumlah Tab
	 * */
	private int tabCounter = 1;
	
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tabmainhost);
		
		tabhost = getTabHost();
		TabHost.TabSpec tabspec;
		Intent intent;
		
		/*
		 * Tab MyChannel
		 * */
		intent = new Intent().setClass(this,MyChannels.class);		
		tabspec = tabhost.newTabSpec(Constants.MyChannel).setIndicator(Constants.MyChannel).setContent(intent);				
		tabhost.addTab(tabspec);	
		tabCounter++;
		/*
		 * Tab Conferences
		 * */
		intent = new Intent().setClass(this,Conferences.class);		
		tabspec = tabhost.newTabSpec(Constants.Conferences).setIndicator(Constants.Conferences).setContent(intent);				
		tabhost.addTab(tabspec);	
		tabCounter++;
		/*
		 * Tab View Friends
		 * */
		
	}
	
	public void addChatTab(TabSpec tabSpec){
		tabhost.addTab(tabSpec);
		tabhost.setCurrentTab(tabCounter);
		tabCounter++;
	}
}
